import tools as Tools
import data as Data

screen = Tools.screen
Actor = Tools.Actor
Animation = Tools.Animation

class Main:
    def __init__(self):
        Tools.Debug(3,'Part6')
    def Enter(self):
        self.Line1 = Actor('straight_line',[Tools.CentralX(),Tools.CentralY()-50])
        self.Line2 = Actor('straight_line',[Tools.CentralX(),Tools.CentralY()+50])
        self.Arrow1 = Actor('arrow',[Tools.CentralX(),-150])
        self.Arrow2 = Actor('arrow',[Data.WIDTH+150,Tools.CentralY()])
        self.Line1.angle=90
        self.Line1.y=Tools.CentralY()
        self.Arrow1.y=60
        self.Line2.y=Tools.CentralY()
        self.Arrow2.angle=-90
        self.Arrow2.x=Data.WIDTH-340
    def Update(self):
        screen.fill((0,0,0))
        screen.draw.text("不大好理解？请看下面的演示",(100,100),"osans4.ttf")
        screen.draw.text("详细解释一下该坐标轴的各个部分, 请看图解.",(100,150),"osans4.ttf")
        screen.draw.text("该坐标轴记作xOy.",(100,200),"osans4.ttf")
        self.Line1.draw()
        self.Line2.draw()
        self.Arrow1.draw()
        self.Arrow2.draw()
        screen.draw.text("原点O",[Tools.CentralX()+50,Tools.CentralY()-50],"osans4.ttf")
        screen.draw.text("横轴x",[Data.WIDTH-350,Tools.CentralY()-50],"osans4.ttf")
        screen.draw.text("纵轴y",[Tools.CentralX()+50,60],"osans4.ttf")